{% extends "base.html" %}
{% load pretty_user %}
{% load match %}
{% load partial_template %}

{% block additional_title %}
Head2Head
{% endblock %}

{% block additional_head %}
<script type="text/javascript" id="js" language="javascript">
$(document).ready(function(){
    $('button.compare').click(function(){
        window.location = "/mdcs/head2head/" + $("#sport").val() + "/" + $("#user1").val() + "/" + $("#user2").val();
    });
});
</script>

{% endblock %}

{% block nav %}
{% partial_template navigation.html selected_tab:"head2head" user:user perms:perms %}
{% endblock %}

{% block content %}
	<div>
        <h2>Izaberite sport</h2>
	</div>
	<select id="sport">
        {% for sport in sports %}<option class="sport" value="{{sport.0}}">{{ sport.1 }}</option>
        {% endfor %}
    </select>
    
	<div>
        <h2>Izaberite igrače</h2>
	</div>
    <select id="user1">
        {% for user in users %}<option class="user1" value="{{user.id}}">{{ user|pretty_user:0 }}</option>
        {% endfor %}
    </select>
	<select id="user2">
        {% for user in users %}<option class="user2" value="{{user.id}}">{{ user|pretty_user:0 }}</option>
        {% endfor %}
    </select>

	<button class="compare">Uporedi</button>
<div class="clear">
</div>
<!-- end clear -->
{% endblock %}